package com.zuipin.service;

import java.util.List;
import java.util.Map;

import com.zuipin.entity.BaseDictionaryData;
import com.zuipin.entity.product.ProductExtInfo;
import com.zuipin.entity.product.TagInfo;
import com.zuipin.framework.exception.CustomException;
import com.zuipin.framework.result.PageResult;
import com.zuipin.framework.result.Result;
import com.zuipin.util.Pagination;
import com.zuipin.vo.BackExtProDetailVo;
import com.zuipin.vo.BackProductPlatformSearchVo;
import com.zuipin.vo.BackProductPlatformVo;
import com.zuipin.vo.IntegralProSearchVo;
import com.zuipin.vo.IntegralProVo;
import com.zuipin.vo.SpecialPriceProVo;

import net.sf.json.JSONObject;

/**
 * 商品拓展信息业务类
 *
 * @ClassName IProductExtInfoService
 * @author wangcongyi
 * @date 2017年5月2日 下午6:11:30
 */
public interface IProductExtInfoService {
	// 根据商品SKU和系统ID获取上架的商品拓展信息
	public ProductExtInfo selectByProSku(JSONObject object);
	
	// 根据商品ID和系统ID获取商品拓展信息
	public ProductExtInfo selectByProId(JSONObject object);
	
	// 根据商品SKU修改商品销售数
	public boolean updateSalesByProSku(JSONObject object);
	
	// 批量修改商品标签信息
	public int updateTagInfoBatch(TagInfo tagInfo, List<String> proSkuList);
	
	// 判断该（商品/商品列表）是否已设置标签信息
	public List<ProductExtInfo> isSettledTagInfo(List<String> proSkuList, Long tagId);
	
	// 根据商品拓展信息ID和上下架状态 查询是否存在
	public ProductExtInfo isExists(JSONObject params);
	
	// 商品上下架
	public boolean modifyState(JSONObject object);
	
	// 根据更新时间和系统ID查询商品信息
	public List<Map<String, Object>> findProExt(JSONObject parmas);
	
	// 删除对应商品标签信息
	public int removeTagInfo(Long sysId, List<String> skus);
	
	public Result productShelf(Long proExtId, Long sysId, String state, Long updateId);
	
	// 通过标签ID查找商品信息列表
	public List<ProductExtInfo> findProExtByTagId(BaseDictionaryData tagInfo);
	
	// 通过商品SKU集和系统ID查询商品拓展信息列表
	public List<ProductExtInfo> findProExtBySkus(JSONObject params);
	
	// 自动更新商品库存
	public void updateStock() throws CustomException;
	
	// 查找商品拓展信息（sku，主图,标题,上下架信息）通过skus
	public List<Map<String, Object>> findProExtList(List<String> skus, String device, Long sysId);
	
	public int deleteByPrimaryKey(Long id);
	
	public int insert(ProductExtInfo record);
	
	public boolean insertSelective(ProductExtInfo record);
	
	public ProductExtInfo selectByPrimaryKey(Long id);
	
	public boolean updateByPrimaryKeySelective(ProductExtInfo record);
	
	public int updateByPrimaryKey(ProductExtInfo record);
	
	// 取消过期的特价商品
	public void cancelExpireSpecialPricePro();
	
	// 设置特价商品
	public void setSpecialPricePro();
	
	public List<ProductExtInfo> findExtProByProIdAll(Long proId);
	
	public Result timingModifyState(Long proExtId, Long sysId, String state, String timing);
	
	/**
	 * 获取前台积分产品列表
	 * @author zhuangjiajian
	 * @param searchVo
	 * @param page
	 * @return
	 */
	public List<IntegralProVo> getIntegralPro(IntegralProSearchVo searchVo, Pagination page);
	
	public PageResult<List<BackProductPlatformVo>> findByProPlatformSearch(BackProductPlatformSearchVo search, Pagination page, Long sysId);
	
	public Result<BackExtProDetailVo> findExtProDetail(Long sysId, String proNo);
	
	public Result createExtPro(BackExtProDetailVo backExtProDetailVo) throws CustomException;
	
	/**
	 * 根据proId查询所有上架的平台商品
	 */
	public List<ProductExtInfo> findExtProByProId(Long proId);
	
	public Result judgeParams(String proNo, Long sysId);
	
	public Result updateExtProDetail(BackExtProDetailVo backExtProDetailVo) throws CustomException;
	
	public List<Map<String, Object>> canOnShelf(String newTime);
	
	public List<Map<String, Object>> canOffShelf(String newTime);
	
	public int updateSkuByProId(Long proId, String proSku);
	
	public ProductExtInfo findProductExtInfoBySku(String proSku, Long sysId);
	
	public Result<List<SpecialPriceProVo>> getSpecialPricePro(String device, Long sysId, Pagination page);
	
	public Result updateAssessmentNum(Long sysId, Long proExtId);
	
	/**
	 * 根据sku同步商品库存
	 */
	public void updateStockBySkus(String skus) throws CustomException;
}
